/*******************************************************************************
 * Odbaul Mobile Client - Tag.java 
 * Copyright (c) Vernalis Systems pvt ltd  2009 
 * This file is licensed from, and is a trade secret of:
 * 	Vernalis Systems pvt ltd
 * 	1,Shakthi Nagar
 * 	Mount Poonamallee road Porur
 * 	Chennai -116
 * TERMS OF USE: Refer your Software License Agreement
 *  Elton Kent - initial API and implementation
 ******************************************************************************/
package com.aphrodite.parser;

/**
 * A class for events indicating the end of an element
 */

class Tag extends ParseEvent {

	String name;
	String namespace;
	StartTag parent;

	Tag(int type, StartTag parent, String namespace, String name) {
		super(type, null);
		this.parent = parent;
		this.namespace = namespace == null ? Xml.NO_NAMESPACE : namespace;
		this.name = name;
	}

	/**
	 * Returns the (corresponding) start tag or the start tag of the parent
	 * element, depending on the event type.
	 */

	StartTag getParent() {
		return parent;
	}

	/** returns the namespace */

	/*
	 * public String getNamespace () { return namespace; }
	 */

	/** returns the (local) name of the element */

	public String getTagName() {
		return name;
	}

	public String toString() {
		return "EndTag </" + name + ">";
	}
}
